using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;

namespace S
{
    /// <summary>
    /// the variables class
    /// </summary>
    public sealed class StaticVariables
    {
        /// <summary>
        /// private default constructor
        /// </summary>
        private StaticVariables()
        {
            // initialize the canvas size
            this.mCanvasSize = new Size(1024, 768);

            // initialize the thumbnail size
            this.mThumbnailSize = new Size(96, 72);

            // initialize the thumbnail margin size
            this.mThumbnailMargin = new Size(3, 3);

            // initialize the initial pen color
            this.mInitialPenColor = Color.Black;

            // initialize the initial background color
            this.mInitialBackgroundColor = Color.White;

            // initialize the initial pen thickness
            this.mInitialPenThickness = 100.0f;

            // initialize the width of the toolbox and screen slider containers
            this.mToolboxContainerWidth = 115;
            this.mScreenSliderContainerWidth = 150;
        }

        /// <summary>
        /// gets the single instance of the variables class
        /// </summary>
        public static StaticVariables Instance
        {
            get
            {
                // if the instance doesnt exist
                if (sInstance == null)
                {
                    // create it using delayed loading
                    sInstance = new StaticVariables();
                }

                // return the instance
                return sInstance;
            }
        }

        /// <summary>
        /// gets the path to the media folder
        /// </summary>
        public string MediaFolder
        {
            get
            {
                return "../media/";
            }
        }

        /// <summary>
        /// gets the initial pen color
        /// </summary>
        public Color InitialPenColor
        {
            get
            {
                return this.mInitialPenColor;
            }
        }

        /// <summary>
        /// gets the initial background color
        /// </summary>
        public Color InitialBackgroundColor
        {
            get
            {
                return this.mInitialBackgroundColor;
            }
        }

        /// <summary>
        /// gets the initial pen thickness
        /// </summary>
        public float InitialPenThickness
        {
            get
            {
                return this.mInitialPenThickness;
            }
        }

        /// <summary>
        /// gets the size of a thumbnail image
        /// </summary>
        public Size ThumbnailSize
        {
            get
            {
                return this.mThumbnailSize;
            }
        }

        /// <summary>
        /// gets the size of the thumbnail margins
        /// </summary>
        public Size ThumbnailMargin
        {
            get
            {
                return this.mThumbnailMargin;
            }
        }

        /// <summary>
        /// gets the ratio between thumbnail and canvas
        /// </summary>
        public float ThumbnailRatio
        {
            get
            {
                return (this.mThumbnailSize.Width / (float)this.mCanvasSize.Width);
            }
        }

        /// <summary>
        /// gets the size of the canvas
        /// </summary>
        public Size CanvasSize
        {
            get
            {
                return this.mCanvasSize;
            }
        }

        /// <summary>
        /// gets the maximum width of the tool options panel
        /// </summary>
        public int ToolOptionPanelsWidth
        {
            get
            {
                return this.mToolboxContainerWidth - 12;
            }
        }

        /// <summary>
        /// gets the size of the toolbox container width
        /// </summary>
        public int ToolboxContainerWidth
        {
            get
            {
                return this.mToolboxContainerWidth;
            }
        }

        /// <summary>
        /// gets the size of the screen slider container width
        /// </summary>
        public int ScreenSliderContainerWidth
        {
            get
            {
                return this.mScreenSliderContainerWidth;
            }
        }

        /// <summary>
        /// the static instance of this singleton class
        /// </summary>
        private static StaticVariables sInstance;

        /// <summary>
        /// the size of the thumbnail image
        /// </summary>
        private Size mThumbnailSize;

        /// <summary>
        /// the size of the thumbnail margin
        /// </summary>
        private Size mThumbnailMargin;

        /// <summary>
        /// the size of the canvas
        /// </summary>
        private Size mCanvasSize;

        /// <summary>
        /// the initial pen color
        /// </summary>
        private Color mInitialPenColor;

        /// <summary>
        /// the initial background color
        /// </summary>
        private Color mInitialBackgroundColor;

        /// <summary>
        /// the initial pen thickness
        /// </summary>
        private float mInitialPenThickness;

        /// <summary>
        /// the width of the toolbox container
        /// </summary>
        private int mToolboxContainerWidth;

        /// <summary>
        /// the width of the screen slider container
        /// </summary>
        private int mScreenSliderContainerWidth;
    }
}
